/*
 * 全局loading的模块
 * @Author: ljb
 * @Date: 2018-01-27 11:39:42
 * @Last Modified by: ljb
 * @Last Modified time: 2018-06-11 10:43:23
 */
export default {

	namespaced: true,

	state: {
		spinshow: false,
		spin_text: '',
	},

	mutations: {
		/* eslint-disable no-param-reassign */
		showSpin(state, text) {
			if (!state.spinshow) {
				state.spinshow = true;
			}

			state.spin_text = text;
		},
		closeSpin(state) {
			state.spinshow = false;
			state.spin_text = '';
		},
		/* eslint-enable no-param-reassign */
	},

	actions: {
	},

	getters: {
		getSpin(state) {
			return state.spinshow;
		},
		getSpinText(state) {
			return state.spin_text;
		},
	},
};
